package com.muyu.danmo.domain;

import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 社区评论 danmo_community_comment
 *
 * @author : kunzong
 * @date : 2024-11-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DanmoCommunityComment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 社区评论ID
     */
    @Excel(name = "社区评论ID")
    private Long id;

    /**
     * 评论内容
     */
    @Excel(name = "评论内容")
    private String content;

    /**
     * 点赞数量
     */
    @Excel(name = "点赞数量")
    private Long likes;

    /**
     * 评论人数
     */
    @Excel(name = "评论人数")
    private Long comments;

    /**
     * 用户评论ID
     */
    @Excel(name = "用户评论ID")
    private Long authorId;

    /**
     * 评论所属帖子ID
     */
    @Excel(name = "评论所属帖子ID")
    private Long postId;

    /**
     * 父评论ID(用于支持嵌套评论)
     */
    @Excel(name = "父评论ID(用于支持嵌套评论)")
    private Long parentCommentId;

    /**
     * 用户名称
     */
    @Excel(name = "用户名称")
    private String authorName;

    /**
     * 用户头像
     */
    @Excel(name = "用户头像")
    private String avatar;

    /**
     * 省份
     */
    @Excel(name = "省份")
    private String province;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String createBy;

    /**
     * 评论创建时间
     */
    @Excel(name = "评论创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 评论删除时间
     */
    @Excel(name = "评论删除时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 是否点赞
     */
    private String isLike;

    /**
     * 是否为自己发表的评论
     */
    private String isMine;

    /**
     * 社区评论点赞
     */
    private List<DanmoCommunityCommentLike> danmoCommunityCommentLikeList;

    private Integer pageNum = 1;
    private Integer pageSize = 10;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("content", getContent())
                .append("authorId", getAuthorId())
                .append("postId", getPostId())
                .append("parentCommentId", getParentCommentId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}